/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package regras;

import Interfaces.CheckerRule;

/**
 *
 * @author Tainá, Ana Luiza e Amanda
 */
public class RuleNumbers02 implements CheckerRule{
     private String password;
    public RuleNumbers02(String password) {
        this.password = password;
    }
    
    @Override
    public int rule(){
        int total = 0;
        String senha = " "+password+" ";
        int number = senha.split("([0-9])").length - 1; 
        if (number>0 && number<password.length()){ 
            total += number * 4;
        }
        return total;
    }    
}
